#! /usr/bin/env python3
# -*- coding:UTF-8 -*-
"""
@Project:   Api_automation
@FileName:  soap.py 
@Create:    2023/7/18 22:21
@Version:   Python3.9  
@Author:    Jia  
@Descr:     ->
"""
from suds.client import Client
import xmltodict

client = Client('http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl')
response = client.service.getMobileCodeInfo('13581855347','')

# 打印请求的XML内容
request_xml = client.last_sent()
print(request_xml)

data = """<root>
  <person>
    <name>John Doe</name>
    <age>25</age>
    <gender>Male</gender>
  </person>
  <person>
    <name>Jane Smith</name>
    <age>30</age>
    <gender>Female</gender>
  </person>
</root>
"""
# 将响应数据转换为字典对象
response_dict = xmltodict.parse(data)
print(response_dict)
